import  time
from selenium import webdriver
from  selenium.webdriver.support  import expected_conditions as EC
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.by import By
driver = webdriver.Chrome()
driver.get("https://www.baidu.com")
time.sleep(2)
print(driver.title)
result1 = WebDriverWait(driver,10,poll_frequency=1).until(EC.title_is("百度一下, 你就知道"),message="超时")
kw = WebDriverWait(driver,10).until(EC.presence_of_element_located((By.ID, 'kw')))
print(kw)
#拆包
kw1 = (By.ID, 'kw')
kw2 = [By.ID, 'kw']
driver.find_element(*kw1).get_attribute('outerHTNL')
driver.find_element(*kw2).get_attribute('outerHTNL')
driver.quit()